﻿using System;

namespace BookSourceVerification.handlers;

/// <summary>
/// 预定义的程序 Handler 逻辑顺序，如果您想自定义业务逻辑那么就不使用 HandlerFactory
/// </summary>
public static class HandlerChainFactory
{
    private static readonly Lazy<HandlerChain> LazyHandlerChain =
        new(() =>
        {
            var handlerChain = new HandlerChain();
            handlerChain.AddLastHandler(new DoubtHandler());
            handlerChain.AddLastHandler(new UrlHandler());
            handlerChain.AddLastHandler(new PingVerifyHandler());
            return handlerChain;
        });

    public static HandlerChain GetHandlerChain()
    {
        return LazyHandlerChain.Value;
    }
}